#ifndef CIGEOM_BOX_H
#define CIGEOM_BOX_H

#include <cmath>
#include <QtOpenGL>

#include "../Core/Color.h"
#include "../Core/Vertex.h"

namespace CIGeom {
    /**
     * This class represents the bounding box for a geometry     
     **/
    class Box {     
        //Friend classes
        friend class Geometry;  

    public:        
        Box (const CICore::Vertex& minb=CICore::Vertex(1000000,1000000,1000000),
             const CICore::Vertex& maxb=CICore::Vertex(-1000000,-1000000,-1000000));    //Constructor
        virtual ~Box();                                                                 //Destructor

    protected:
        CICore::Vertex min, max;                //The minimum and maximum box's vertices

        //Utility private methods
        void Draw() const;                      //Method called to render the box
    
    public:
        //Utility Methods
        void Render() const;                    //Method called to render the box
        void RenderFilled() const;              //Method called to render the box filled
        CICore::Point GetCentre() const;        //Method called to get the box's centre
        void Update (const CICore::Vertex& v);  //Method called to update the box so that it contains the vertex v
                                
    };            
}
#endif /* CIGEOM_BOX_H */
